package com.fudan.adse.domain.bo;

import com.fudan.adse.domain.cont.SeatStatus;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Jerry Zhang
 * create: 2022-11-23 22:23
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SeatBO {
    private int rowPieceId;
    private int id;
    private int row;
    private int col;
    private SeatStatus status; // 使用情况：已预订、已售出、空闲

    public void init(int id, int rowPieceId, SeatStatus status) {
        this.id = id;
        this.rowPieceId = rowPieceId;
        this.status = status;
        this.row = (id / 10) + 1;
        this.col = (id % 10);
    }
}
